cmake_minimum_required(VERSION 3.4.1)

find_library(log-lib
        log)

set(distribution_DIR ../../../../libs)

add_library(native-lib
        SHARED
        src/main/cpp/native-lib.cpp)


add_library(avutil
        SHARED
        IMPORTED)
set_target_properties(avutil
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/armeabi/libavutil.so)

add_library(swresample
        SHARED
        IMPORTED)
set_target_properties(swresample
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/armeabi/libswresample.so)

add_library(avcodec
            SHARED
            IMPORTED)
set_target_properties(avcodec
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/armeabi/libavcodec.so)

add_library(avfilter
        SHARED
        IMPORTED)
set_target_properties(avfilter
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/armeabi/libavfilter.so)

add_library(swscale
        SHARED
        IMPORTED)
set_target_properties(swscale
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/armeabi/libswscale.so)

add_library(avdevice
        SHARED
        IMPORTED)
set_target_properties(avdevice
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/armeabi/libavdevice.so)

add_library(avformat
        SHARED
        IMPORTED)
set_target_properties(avformat
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/armeabi/libavformat.so)

include_directories(libs/include)

target_link_libraries(native-lib
        swresample
        avcodec
        avfilter
        swscale
        avdevice
        avformat
        avutil
        ${log-lib})